package cn.bugstack.domain.activity.adapter.repository;

// import cn.bugstack.domain.activity.model.entity.UserGroupBuyOrderDetailEntity;

import cn.bugstack.domain.activity.model.entity.UserGroupBuyOrderDetailEntity;
import cn.bugstack.domain.activity.model.valobj.GroupBuyActivityDiscountVO;
import cn.bugstack.domain.activity.model.valobj.SCSkuActivityVO;
import cn.bugstack.domain.activity.model.valobj.SkuVO;
import cn.bugstack.domain.activity.model.valobj.TeamStatisticVO;
// import cn.bugstack.domain.activity.model.valobj.SCSkuActivityVO;
// import cn.bugstack.domain.activity.model.valobj.SkuVO;
// import cn.bugstack.domain.activity.model.valobj.TeamStatisticVO;

import java.util.List;

/**
 * @description 活动仓储，用来从数据库查询数据
 */
public interface IActivityRepository {

    // 查询活动-折扣的VO，只传 activityId 参数
    GroupBuyActivityDiscountVO queryGroupBuyActivityDiscountVO(Long activityId);

    SkuVO querySkuByGoodsId(String goodsId);

    // 查询 sc-商品-活动关联表，根据 s c 商品id
    SCSkuActivityVO querySCSkuActivityBySCGoodsId(String source, String channel, String goodsId);

    // 判断是否 是优惠人群的标签
    boolean isTagCrowdRange(String tagId, String userId);

    // 判断是否降级拦截，限制访问量
    boolean downgradeSwitch();

    // 判断用户是否切量拦截
    boolean cutRange(String userId);

    // 查询该用户在该活动下的前 ownerCount个拼团
    List<UserGroupBuyOrderDetailEntity> queryInProgressUserGroupBuyOrderDetailListByOwner(Long activityId, String userId, Integer ownerCount);

    // 查询非属该用户在该活动的 随机 randomCount个拼团
    List<UserGroupBuyOrderDetailEntity> queryInProgressUserGroupBuyOrderDetailListByRandom(Long activityId, String userId, Integer randomCount);

    // 统计活动拼团的数据   队伍总数, 成团数量, 参与总人数
    TeamStatisticVO queryTeamStatisticByActivityId(Long activityId);

}
